package com.anxin.act.task.entity;

import com.anxin.common.utils.sys.UserUtils;
import com.anxin.sys.system.entity.SysUser;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.anxin.framework.aspectj.lang.annotation.Excel;
import com.anxin.framework.web.entity.BaseEntity;
import java.util.Date;
import java.util.List;

/**
 * 待办任务视图对象 view_ru_task
 *
 * @author jbs
 * @date 2021-10-24
 */
//@ApiModel(description = "待办任务视图")
public class ViewRuTask extends BaseEntity<ViewRuTask>{
    private static final long serialVersionUID = 1L;

    /** 任务ID  */
    //@ApiModelProperty(value = "任务ID",position=10)
    private String id;

    /** Activiti 任务ID  */
    //@ApiModelProperty(value = "Activiti 任务ID",position=10)
    private String taskId;

    /** 任务名称  */
    //@ApiModelProperty(value = "任务名称",position=20)
    private String taskName;

    /** 流程ID  */
    //@ApiModelProperty(value = "流程ID",position=30)
    private String actId;

    /** 审批人登录名  */
    //@ApiModelProperty(value = "审批人登录名",position=40)
    private String assignee;

    /** 审批人ID  */
    //@ApiModelProperty(value = "审批人ID",position=40)
    private String assigneeId;

    /** 审批人名称  */
    //@ApiModelProperty(value = "审批人名称",position=40)
    private String assigneeName;

    /** 任务类型  */
    //@ApiModelProperty(value = "任务类型",position=50)
    private String type;

    /** 流程实例名称 */
    //@ApiModelProperty(value = "流程实例名称",position=60)
    private String title;

    /** 申请用户昵称 */
    //@ApiModelProperty(value = "用户登录名",position=70)
    private String applyLoginName;

    /** 用户昵称 */
    //@ApiModelProperty(value = "用户昵称",position=80)
    private String applyNickName;

    /** 申请用户ID */
    //@ApiModelProperty(value = "申请用户ID",position=70)
    private String applyUserId;

    /** 开始时间 */
    //@ApiModelProperty(value = "开始时间",position=80)
    private Date startTime;

    /** 流程启动时间 */
    //@ApiModelProperty(value = "流程启动时间",position=80)
    private Date actStartTime;

    /** 名称 */
    //@ApiModelProperty(value = "名称",position=90)
    private String processName;

    /** 是否挂起 */
    //@ApiModelProperty(value = "是否挂起",position=90)
    private String hang;

    /** 是否加急 */
    //@ApiModelProperty(value = "是否加急",position=90)
    private String urgent;

    /**
     * 是否未读
     */
    private Boolean readStatus;

    /**
     * 审批人登录名集合
     */
    private List<String> assigneeList;

    /**
     * 初始化数据
     * @return
     */
    public ViewRuTask(){

    }

    /**
     * 审批审批人等数据
     */
    public void intiData(){
        SysUser applyUser = UserUtils.findByUserNameContainsDelete(this.applyLoginName);
        if (applyUser != null){
            this.applyNickName = applyUser.getNickName();
        }
        SysUser assigneeUser = UserUtils.findByUserNameContainsDelete(this.assignee);
        if (assigneeUser != null){
            this.assigneeName = assigneeUser.getNickName();
            this.assigneeId = assigneeUser.getId();
        }

    }

    public String getAssigneeId() {
        return assigneeId;
    }

    public void setAssigneeId(String assigneeId) {
        this.assigneeId = assigneeId;
    }

    public String getAssigneeName() {
        return assigneeName;
    }

    public void setAssigneeName(String assigneeName) {
        this.assigneeName = assigneeName;
    }

    public String getApplyUserId() {
        return applyUserId;
    }

    public void setApplyUserId(String applyUserId) {
        this.applyUserId = applyUserId;
    }



    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public void setTaskName(String taskName){
        this.taskName = taskName;
    }

    public String getTaskName(){
        return taskName;
    }
    public void setActId(String actId){
        this.actId = actId;
    }

    public String getActId(){
        return actId;
    }
    public void setAssignee(String assignee){
        this.assignee = assignee;
    }

    public String getAssignee(){
        return assignee;
    }
    public void setType(String type){
        this.type = type;
    }

    public String getType(){
        return type;
    }
    public void setTitle(String title){
        this.title = title;
    }

    public String getTitle(){
        return title;
    }

    public String getApplyLoginName() {
        return applyLoginName;
    }

    public void setApplyLoginName(String applyLoginName) {
        this.applyLoginName = applyLoginName;
    }

    public void setStartTime(Date startTime){
        this.startTime = startTime;
    }

    public Date getStartTime(){
        return startTime;
    }

    public String getApplyNickName() {
        return applyNickName;
    }

    public void setApplyNickName(String applyNickName) {
        this.applyNickName = applyNickName;
    }

    public void setProcessName(String processName){
        this.processName = processName;
    }

    public String getProcessName(){
        return processName;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public void setId(String id) {
        this.id = id;
    }

    public String getHang() {
        return hang;
    }

    public void setHang(String hang) {
        this.hang = hang;
    }

    public Date getActStartTime() {
        return actStartTime;
    }

    public void setActStartTime(Date actStartTime) {
        this.actStartTime = actStartTime;
    }

    public List<String> getAssigneeList() {
        return assigneeList;
    }

    public void setAssigneeList(List<String> assigneeList) {
        this.assigneeList = assigneeList;
    }

    public String getUrgent() {
        return urgent;
    }

    public void setUrgent(String urgent) {
        this.urgent = urgent;
    }

    public Boolean getReadStatus() {
        return readStatus;
    }

    public void setReadStatus(Boolean readStatus) {
        this.readStatus = readStatus;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("taskId", getTaskId())
            .append("taskName", getTaskName())
            .append("actId", getActId())
            .append("assignee", getAssignee())
            .append("type", getType())
            .append("title", getTitle())
            .append("applyNickName", getApplyNickName())
            .append("startTime", getStartTime())
            .append("processName", getProcessName())
            .toString();
    }
}
